#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <pthread.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>

#define D_LEN 50
#define D_SIZE 300

#define COUNT 2
#define BUFF_SIZE 1024
#define CH_SIZE 300

struct pthread_block {
	int fd1;
	int fd2;
	size_t start;
	size_t end;
};

struct file_quality{
	char name[D_SIZE];
	char time[30];
	int type;
};

struct file_rate {
	int num;
	int sum;
};

void copy_file(char *file1, char *file2);
void mkdir_file(char *path);
int q_directory(char *path, struct file_quality ch[]);
void backup_directory(char *path1, char *path2, struct file_rate *filerate);
void remove_directory(char *path);
void oneway_syn(char *path1, char *path2, struct file_rate *filerate);
void twoway_syn(char *path1, char *path2, struct file_rate *filerate);
void *putout_rate (void *arg);
void num_file(char *path, struct file_rate *filerate);


